#include "light.h"


light::light()
{
	ambient = color(1.0f, 1.0f, 1.0f, 1.0f);
	standardSet();
}
light::light(color Color)
{
	ambient = Color;
	standardSet();
}
light::light(float R, float G, float B)
{
	ambient = color(R,G,B);
	standardSet();
}
light::light(float RGB)
{
	ambient = color(RGB,RGB,RGB);
	standardSet();
}
light::~light()
{

}
void light::getLightFromXML(std::ifstream &file)
{

}
void light::standardSet()
{
	multiplyier				= 1.0;
	decayInverseConstParam	= 1.0;
	decayInverseLinParam	= 0.0;
	decayInverseSqrParam	= 0.0;
	ambienCoef				= 0.5;
	position.set(0.0,0.0,0.0);
	directrion.set(0.0,0.0,0.0);
	isAmbient				= true;
	castShadow				= false;
	decay					= false;
}
void light::setAmbient(color amb)
{
	ambient = amb;
}
color light::getAmbient()
{
	return ambient;
}
void light::setDecayParams(double constant, double linear, double square)
{
	decayInverseConstParam = constant;
	decayInverseLinParam = linear;
	decayInverseSqrParam = square;
}
void light::setOrjentation(point poz, vector3 dir)
{
	position = poz;
	directrion = dir;
	directrion.normalize();
}
void light::setPosition(point poz)
{
	position = poz;
}
void light::setDirection(vector3 dir)
{
	directrion = dir;
	directrion.normalize();
}
point light::getPosition()
{
	return position;
}
vector3 light::getDirection(point directionTo)
{
	vector3 temp(position, directionTo);
	temp.normalize();
	return temp;
}
photon light::emitPhoton()
{
	return photon();
}